@layer base {
  * :not(svg, path, g) {
    @apply m-0 box-border p-0 font-System text-sm;
  }
  body {
    @apply bg-home;
    @apply text-text1;
  }
  .bg-home {
    @apply text-text1;
    @apply fill-text1;
  }
  input {
    @apply w-full rounded-md border-[1px] border-solid border-gray bg-dark px-2 py-1 text-sm text-text1 outline-none placeholder:text-text3 focus:border-active;
  }
  button {
    @apply cursor-pointer overflow-hidden rounded-md border-0 bg-gray px-3 py-1 text-text1 focus:outline-none active:animate-click;
  }
  textarea {
    @apply flex-1 resize-none rounded-md border-[1px] border-solid border-gray bg-dark py-1 pl-2 text-base text-text1 caret-text2 transition-none placeholder:text-text3 focus:border-active focus:outline-none;
  }
  a {
    @apply text-text-link hover:text-active;
  }
}

@tailwind base;
@tailwind components;
@tailwind utilities;

button:hover {
  @apply text-text1/80;
}

/* 选择 */
::selection {
  @apply bg-selection;
}

/* 滚动条基础样式 */
::-webkit-scrollbar {
  width: 0px;
  height: 6px;
}
::-webkit-scrollbar-track {
  opacity: 0;
}
::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background-color: #c0c1c5;
  width: 8px;
}
::-webkit-scrollbar-thumb:hover {
  background-color: #a8a8a8;
}

/* 自定义样式（tailwind无法覆盖的） */
.scrollbar-hidden::-webkit-scrollbar {
  display: none;
}
.cyber-box {
  position: relative;
  border-radius: 16px;
  border: 4px solid transparent;
}
.cyber-box::after {
  content: '';
  position: absolute;
  width: calc(100% + 4px);
  height: calc(100% + 4px);
  top: -2px;
  left: -2px;
  z-index: -20;
  border-radius: 18px;
  @apply bg-cyber;
}
.cyber-box[data-active]::after {
  @apply bg-cyber-pro;
}
.no-scroll-bar::-webkit-scrollbar {
  display: none;
}
.scrollbar-show {
  overflow: auto;
}
.scrollbar-show::-webkit-scrollbar {
  width: 0.45rem;
  height: 6px;
}
.scrollbar-translucent::-webkit-scrollbar-thumb {
  background-color: #c0c1c540;
}
.scrollbar-transparent::-webkit-scrollbar-thumb {
  background-color: transparent;
}

:root {
  --gomoon-md-fontsize: 14px; /* 默认值 */
}

.gomoon-input {
  font-size: var(--gomoon-md-fontsize);
}

.gomoon-md {
  font-size: var(--gomoon-md-fontsize);
}

.gomoon-md *:not(svg, path, g) {
  font-size: inherit;
  line-height: 1.5;
}

.markdown h1 {
  font-size: 1.52em;
  margin: 0.5em 0 0.5em;
}
.markdown h2 {
  font-size: 1.34em;
  margin: 0.5em 0 0.3em;
}

.markdown h3 {
  font-size: 1.25em;
  margin: 0.5em 0 0.3rem;
}

.markdown h4 {
  font-size: 1.1em;
  margin: 0.5em 0 0.3rem;
}

.markdown img {
  margin-top: 12px;
}

.markdown ol,
.markdown ul {
  margin-left: 16px;
}

.markdown pre {
  margin-bottom: 12px;
}

.markdown table {
  font-size: 0.9em;
}

.markdown table thead tr {
  background-color: #64748b40;
  text-align: left;
}

.markdown table th,
.markdown table td {
  padding: 0.6em 1em;
}

.markdown table tbody tr:last-of-type {
  border-bottom: 2px solid #64748b40;
}

.hljs {
  @apply text-text-code !important;
}

.markdown code:not(.hljs) {
  @apply bg-inline-code;
  @apply text-text2;
  border-radius: 0.4em;
  padding: 0.03em 0.2em;
  margin: 0 4px;
}

.win .markdown code:not(.hljs) {
  padding: 0em 0.2em;
}

.markdown code {
  @apply bg-code;
  border-radius: 0.4em;
}

.markdown a {
  color: #2382c6;
}

.markdown a:hover {
  @apply text-active;
}

.markdown blockquote {
  border-left: 0.2em solid #64748b;
  padding: 0.5em 0.5em;
  margin: 0.5em 0;
}
